    
// Initialize activity data
var gActivities = [];
{% for activity in activities %}
var activity = {{ activity|safe }};
gActivities.push(activity);
{% endfor %}
{% if not list %}var gActivity = gActivities[0];{% endif %}